//用于登录

const { adminsModel } = require('./models/adminsModel');
const { salesmansModel } = require('./models/salesmansModel')


//管理员登录
module.exports.login = async parms => {
    return await adminsModel.find(parms);
}

//销售登录
module.exports.loginForSalesmans = async parms => {
    return await salesmansModel.find(parms);
}

//注册
module.exports.register = async parms => {
    const data = await usersModel.create(parms);
    // const data =await usersModel.find({usersname});
    return data;
}

//判断用户名是否一样
module.exports.isexit = async parms => {
    const data = await usersModel.find({ usersname: parms.usersname });
    return data;
}
